home *** CD-ROM | disk | FTP | other *** search
- package views
- {
- import flash.accessibility.*;
- import flash.debugger.*;
- import flash.display.*;
- import flash.errors.*;
- import flash.events.*;
- import flash.external.*;
- import flash.filters.*;
- import flash.geom.*;
- import flash.media.*;
- import flash.net.*;
- import flash.printing.*;
- import flash.profiler.*;
- import flash.system.*;
- import flash.text.*;
- import flash.ui.*;
- import flash.utils.*;
- import flash.xml.*;
- import mx.binding.*;
- import mx.containers.HBox;
- import mx.containers.TitleWindow;
- import mx.containers.VBox;
- import mx.controls.Button;
- import mx.controls.Image;
- import mx.core.UIComponentDescriptor;
- import mx.core.mx_internal;
- import mx.events.CloseEvent;
- import mx.events.PropertyChangeEvent;
- import mx.managers.PopUpManager;
- import mx.styles.*;
-
- public class PrintSelection extends TitleWindow
- {
- private static var _watcherSetupUtil:IWatcherSetupUtil;
-
- private var _bindings:Array;
-
- [Bindable]
- private var _607087477_Image1:Image;
-
- public var _bindingsByDestination:Object;
-
- private var _documentDescriptor_:UIComponentDescriptor;
-
- [Bindable]
- private var _55416021leftBtn:Button;
-
- [Bindable]
- private var _69177115bothBtn:Button;
-
- public var _bindingsBeginWithWord:Object;
-
- [Bindable]
- private var _1423340355oCreator:MyPrintJob;
-
- [Bindable]
- private var _859611628imageURL:String;
-
- [Bindable]
- private var _1436107104rightBtn:Button;
-
- private var _watchers:Array;
-
- public function PrintSelection()
- {
- _documentDescriptor_ = new UIComponentDescriptor({
- "type":TitleWindow,
- "propertiesFactory":function():Object
- {
- return {"childDescriptors":[new UIComponentDescriptor({
- "type":VBox,
- "stylesFactory":function():void
- {
- this.horizontalAlign = "center";
- },
- "propertiesFactory":function():Object
- {
- return {"childDescriptors":[new UIComponentDescriptor({
- "type":Image,
- "id":"_Image1",
- "propertiesFactory":function():Object
- {
- return {
- "width":380,
- "height":245
- };
- }
- }),new UIComponentDescriptor({
- "type":HBox,
- "stylesFactory":function():void
- {
- this.horizontalGap = 40;
- },
- "propertiesFactory":function():Object
- {
- return {
- "y":255,
- "width":380,
- "childDescriptors":[new UIComponentDescriptor({
- "type":Button,
- "id":"leftBtn",
- "events":{"click":"__leftBtn_click"},
- "propertiesFactory":function():Object
- {
- return {
- "label":"Left",
- "width":100
- };
- }
- }),new UIComponentDescriptor({
- "type":Button,
- "id":"bothBtn",
- "events":{"click":"__bothBtn_click"},
- "propertiesFactory":function():Object
- {
- return {
- "label":"Both",
- "width":100
- };
- }
- }),new UIComponentDescriptor({
- "type":Button,
- "id":"rightBtn",
- "events":{"click":"__rightBtn_click"},
- "propertiesFactory":function():Object
- {
- return {
- "label":"Right",
- "width":100
- };
- }
- })]
- };
- }
- })]};
- }
- })]};
- }
- });
- super();
- mx_internal::_document = this;
- if(!this.styleDeclaration)
- {
- this.styleDeclaration = new CSSStyleDeclaration();
- }
- this.styleDeclaration.defaultFactory = function():void
- {
- this.horizontalCenter = 0;
- this.verticalCenter = 0;
- };
- this.title = "Which page would you like to print?";
- this.showCloseButton = true;
- this.layout = "absolute";
- this.addEventListener("close",___TitleWindow1_close);
- }
-
- public static function set watcherSetupUtil(param1:IWatcherSetupUtil) : void
- {
- PrintSelection._watcherSetupUtil = param1;
- }
-
- public function set imageURL(param1:String) : void
- {
- var _loc2_:Object = null;
- _loc2_ = this._859611628imageURL;
- if(_loc2_ !== param1)
- {
- this._859611628imageURL = param1;
- dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"imageURL",_loc2_,param1));
- }
- }
-
- private function _PrintSelection_bindingExprs() : void
- {
- var _loc1_:* = undefined;
- _loc1_ = "images/large/" + imageURL;
- }
-
- [Bindable(event="propertyChange")]
- public function get oCreator() : MyPrintJob
- {
- return this._1423340355oCreator;
- }
-
- private function clickHandler(param1:Event) : void
- {
- switch(param1.target)
- {
- case leftBtn:
- oCreator.whichPage = "left";
- break;
- case rightBtn:
- oCreator.whichPage = "right";
- break;
- case bothBtn:
- oCreator.whichPage = "both";
- }
- oCreator.doPrinting();
- closeDialog(null);
- }
-
- [Bindable(event="propertyChange")]
- public function get leftBtn() : Button
- {
- return this._55416021leftBtn;
- }
-
- public function set rightBtn(param1:Button) : void
- {
- var _loc2_:Object = null;
- _loc2_ = this._1436107104rightBtn;
- if(_loc2_ !== param1)
- {
- this._1436107104rightBtn = param1;
- dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"rightBtn",_loc2_,param1));
- }
- }
-
- private function closeDialog(param1:CloseEvent) : void
- {
- PopUpManager.removePopUp(this);
- }
-
- public function set oCreator(param1:MyPrintJob) : void
- {
- var _loc2_:Object = null;
- _loc2_ = this._1423340355oCreator;
- if(_loc2_ !== param1)
- {
- this._1423340355oCreator = param1;
- dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"oCreator",_loc2_,param1));
- }
- }
-
- private function _PrintSelection_bindingsSetup() : void
- {
- var binding:Binding = null;
- if(!_bindings)
- {
- _bindings = [];
- }
- if(!_watchers)
- {
- _watchers = [];
- }
- binding = new Binding(this,function():Object
- {
- return "images/large/" + imageURL;
- },function(param1:Object):void
- {
- _Image1.source = param1;
- },"_Image1.source");
- _bindings[0] = binding;
- }
-
- public function __leftBtn_click(param1:MouseEvent) : void
- {
- clickHandler(param1);
- }
-
- public function ___TitleWindow1_close(param1:CloseEvent) : void
- {
- closeDialog(param1);
- }
-
- public function set leftBtn(param1:Button) : void
- {
- var _loc2_:Object = null;
- _loc2_ = this._55416021leftBtn;
- if(_loc2_ !== param1)
- {
- this._55416021leftBtn = param1;
- dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"leftBtn",_loc2_,param1));
- }
- }
-
- [Bindable(event="propertyChange")]
- public function get imageURL() : String
- {
- return this._859611628imageURL;
- }
-
- [Bindable(event="propertyChange")]
- public function get rightBtn() : Button
- {
- return this._1436107104rightBtn;
- }
-
- public function set bothBtn(param1:Button) : void
- {
- var _loc2_:Object = null;
- _loc2_ = this._69177115bothBtn;
- if(_loc2_ !== param1)
- {
- this._69177115bothBtn = param1;
- dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"bothBtn",_loc2_,param1));
- }
- }
-
- public function set _Image1(param1:Image) : void
- {
- var _loc2_:Object = null;
- _loc2_ = this._607087477_Image1;
- if(_loc2_ !== param1)
- {
- this._607087477_Image1 = param1;
- dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"_Image1",_loc2_,param1));
- }
- }
-
- public function __rightBtn_click(param1:MouseEvent) : void
- {
- clickHandler(param1);
- }
-
- [Bindable(event="propertyChange")]
- public function get bothBtn() : Button
- {
- return this._69177115bothBtn;
- }
-
- override public function initialize() : void
- {
- var target:PrintSelection = null;
- var watcherSetupUtilClass:Object = null;
- mx_internal::setDocumentDescriptor(_documentDescriptor_);
- _PrintSelection_bindingsSetup();
- target = this;
- if(_watcherSetupUtil == null)
- {
- watcherSetupUtilClass = getDefinitionByName("_views_PrintSelectionWatcherSetupUtil");
- watcherSetupUtilClass["init"](null);
- }
- _watcherSetupUtil.setup(this,function(param1:String):*
- {
- return target[param1];
- },_bindings,_watchers);
- super.initialize();
- }
-
- [Bindable(event="propertyChange")]
- public function get _Image1() : Image
- {
- return this._607087477_Image1;
- }
-
- public function __bothBtn_click(param1:MouseEvent) : void
- {
- clickHandler(param1);
- }
- }
- }
-
-